﻿using IBLL;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Model;

namespace ZY5.API.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class ShopController : ControllerBase
    {
        public ShopController(IShopBLL bll)
        {
            Bll = bll;
        }

        public IShopBLL Bll { get; }
        [HttpPost]
         public async Task<int> AddShop(ShopModel shop)
        {
            return await Bll.AddShop(shop);
        }
        [HttpGet]
        public Task<int> DeleteShop(int id)
        {
            return Bll.DeleteShop(id);
        }
        [HttpGet]
        public dynamic GetShopShow(string? name, int? pid, DateTime? dateTime, int state)
        {
            return Bll.GetShopShow(name, pid, dateTime, state);
        }
        [HttpPost]
        public Task<int> UpdateShop(ShopModel shop)
        {
            return Bll.UpdateShop(shop);
        }
    }
}
